package com.shuhe.metastore;

import org.apache.log4j.Logger;
import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBFactory;
import org.influxdb.dto.Query;
import org.influxdb.dto.QueryResult;


//目标库为mysql
public class DbInflux {
    private static Logger logger = Logger.getLogger(DbInflux.class);

    public static InfluxDB influxDbBuild(String url, String username, String password) throws Exception {
        InfluxDB influxDB = InfluxDBFactory.connect(url, username, password);
        return influxDB;
    }

    //query(new Query(selectColumnColSql, cqlb.getDb_name()))
    public static org.influxdb.dto.QueryResult queryResult(InfluxDB influxDB, String sql, String dbName) {
        org.influxdb.dto.QueryResult queryResult = influxDB.query(new Query(sql, dbName));
        return queryResult;
    }


}
